<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <base href="${request.contextPath}/"/>
    <meta name="renderer" content="webkit|ie-comp|ie-stand"/>
    <meta name="viewport" content="width=device-width"/>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="renderer" content="webkit">
    <meta name="viewport" content="width=device-width, initial-scale=1"/>
    <link rel="icon" href="favicon.ico">

    <title>小区管理</title>
    <link href="Content/pace/pace-theme-minimal.css" rel="stylesheet"/>
    <link href="Content/font/css/font-awesome.min.css" rel="stylesheet"/>
    <link href="Content/bootstrap/bootstrap.min.css" rel="stylesheet"/>
    <link href="Content/view/index.css" rel="stylesheet"/>

    <script src="Content/pace/pace.min.js"></script>
    <script src="Content/jquery/jquery-1.10.2.min.js"></script>
    <script src="Content/bootstrap/bootstrap.min.js"></script>
    <script src="Content/jquery/plugin/jqprint/jquery.jqprint-0.3.js"></script>

    <script src="Content/laydate/laydate.js"></script>


    <!--[if lt IE 9]>
    <script src="~/Content/bootstrap/html5shiv.min.js"></script>
    <script src="~/Content/bootstrap/respond.min.js"></script>
    <![endif]-->
    <script>
        function request(d) {
            for (var c = location.search.slice(1).split("&"), a = 0; a < c.length; a++) {
                var b = c[a].split("=");
                if (b[0] == d) if ("undefined" == unescape(b[1])) break; else return unescape(b[1])
            }
            return ""
        };
    </script>
    <script>
//   *LaoNa* 写后台的地址，底下直接饮用
        var controlUrl = '/pccontrol/basics/address/city';
//  *LaoNa*  不知道干啥的，应该是翻页用的，写当前地址
        var lrCurrentUrl = controlUrl+'/Index';
        var lrModuleButtonList;
        var lrModuleColumnList;
        var lrModule;
    </script>
</head>

<body class="Firefox 63.0 lr-uitheme-default">

<div class="lr-layout">
    <div class="lr-layout-center">
        <div class="lr-layout-wrap lr-layout-wrap-notitle">
            <div class="lr-layout-tool">
                <div class="lr-layout-tool-left">
                    <!--<div class="lr-layout-tool-item">
                        <input id="txt_Keyword" type="text" class="form-control" placeholder="请输入要查询求组人的姓名"/>
                    </div>
                    <div class="lr-layout-tool-item">
                        <a id="btn_Search" class="btn btn-primary btn-sm"><i class="fa fa-search"></i>&nbsp;<span
                                class="lrlg">查询</span></a>
                    </div>-->
                </div>
                <div class="lr-layout-tool-right">
                    <div class=" btn-group btn-group-sm">
                        <a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a>
                    </div>
                    <div class=" btn-group btn-group-sm" learun-authorize="yes">
<!--                        <a id="lr_show" class="btn btn-default"><i class="fa fa-facebook"></i>&nbsp;<span class="lrlg">展示</span></a>-->
<!--                        <a id="lr_hidden" class="btn btn-default"><i class="fa fa-outdent"></i>&nbsp;<span class="lrlg">取消展示</span></a>-->
                        <a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;<span
                                class="lrlg">新增</span></a>
                        <a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i>&nbsp;<span
                                class="lrlg">编辑</span></a>
<!--                        <a id="lr_query" class="btn btn-default"><i class="fa fa-search"></i>&nbsp;<span-->
<!--                                class="lrlg">查看</span></a>-->
                        <a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i>&nbsp;<span class="lrlg">删除</span></a>
                        <!--                        <a id="lr_import_public" class="btn btn-default"><i class="fa fa-arrow-down"></i>&nbsp;<span class="lrlg">导入</span></a>-->
                    </div>
                </div>
            </div>

            <div class="lr-layout-body" id="gridtable"></div>
        </div>
    </div>
</div>
<script>
    var selectedRow;
    var refreshGirdData;
    var flag;
    var bootstrap = function (a, b) {
        var c = {
            init: function () {
                c.initGrid();
                c.bind()
            },
            bind: function () {
                /*a("#btn_Search").on("click", function () {
                    var d = a("#txt_Keyword").val();
                    c.search({
                        keyword: d
                    })
                });*/
                a("#lr_refresh").on("click", function () {
                    location.reload()
                });
                a("#lr_show").on("click", function () {
                    var d = a("#gridtable").jfGridValue("id");
                    var f = {}
                    if (b.checkrow(d)) {
                        a.lrSaveForm(top.$.rootUrl + controlUrl + "/SaveForm?keyValue=" + d + "&isshow=1", f, function (h) {
                            if (h.code == 200) {
                                b.frameTab.currentIframe().refreshGirdData();
                            }
                        })
                    }
                });
                a("#lr_hidden").on("click", function () {
                    var d = a("#gridtable").jfGridValue("id");
                    var f = {}
                    if (b.checkrow(d)) {
                        a.lrSaveForm(top.$.rootUrl +  controlUrl + "/SaveForm?keyValue=" + d + "&isshow=0", f, function (h) {
                            if (h.code == 200) {
                                b.frameTab.currentIframe().refreshGirdData();
                            }
                        })
                    }
                });
                a("#lr_add").on("click", function () {
                    selectedRow = null;
                    flag = "add";
                    b.layerForm({
                        id: "form",
                        title: "添加市县信息",
                        url: top.$.rootUrl +  controlUrl + "/Form",
                        width: 700,
                        height: 180,
                        callBack: function (d) {
                            return top[d].acceptClick(refreshGirdData)
                        }
                    })
                });
                a("#lr_edit").on("click", function () {
                    var d = a("#gridtable").jfGridValue("id");
                    selectedRow = a("#gridtable").jfGridGet("rowdata");
                    flag =  "edit";
                    if (b.checkrow(d)) {
                        b.layerForm({
                            id: "form",
                            title: "编辑市县信息",
                            url: top.$.rootUrl +  controlUrl + "/Form?keyValue=" + d,
                            width: 700,
                            height: 180,
                            callBack: function (e) {
                                return top[e].acceptClick(refreshGirdData)
                            }
                        })
                    }
                });
                a("#lr_delete").on("click", function () {
                    var d = a("#gridtable").jfGridValue("id");
                    var f = {}
                    if (b.checkrow(d)) {
                        a.lrSaveForm(top.$.rootUrl + controlUrl + "/SaveForm?keyValue=" + d + "&isshow=3", f, function (h) {
                            if (h.code == 200) {
                                b.frameTab.currentIframe().refreshGirdData();
                            }
                        })
                    }
                });
            },
            initGrid: function () {
                a("#gridtable").jfGrid({
                    url: top.$.rootUrl + controlUrl + "/GetList",
                    headData: [/*{
                        label: "id",
                        name: "id",
                        width: 100,
                        align: "left",
                        sortName: "id"
                    },*/{
                        label: "省份名称",
                        name: "provincename",
                        width: 200,
                        align: "left",
                    }, {
                        label: "市县名称",
                        name: "cityname",
                        width: 100,
                        align: "left",
                    }],
                    isPage: true,
                    sidx: "date",
                    sord: "desc",
                    reloadSelected: true,
                    mainId: "id"
                });
                c.search()
            },
            search: function (d) {
                d = d || {};
                a("#gridtable").jfGridSet("reload", d)
            }
        };
        refreshGirdData = function () {
            a("#gridtable").jfGridSet("reload")
        };
        c.init()
    };
</script>


<script src="Content/view/index.js"></script>

</body>

</html>
